package com.hqyj.controller;


import com.hqyj.pojo.ResultVoH;
import com.hqyj.pojo.Sale;
import com.hqyj.service.ISaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lsr
 * @since 2022-10-03
 */
@RestController
@RequestMapping("/sale")
public class SaleController {

    @Autowired
    private ISaleService iSaleService;

    @GetMapping("/buy")
    public ResultVoH buy(Sale sale){
        return iSaleService.buy(sale);
    }

    @GetMapping("/list")
    public ResultVoH saleList(Sale sale){
        return iSaleService.saleList(sale);
    }
    //根据类型生成chart
    @GetMapping("/chart")
    public ResultVoH saleTypeChart(){
        return iSaleService.saleChart();
    }

}

